<template>
  <div id="app">
      <router-view></router-view>
  </div>
</template>

<script>
//  import beeflex from "bee-flex";
import {mapState,mapMutations} from 'vuex'
window.onload = window.onresize =function () {
  var documentElementWidth =document.body.clientWidth
  if(documentElementWidth>=750){
    $('.aside').css({
      'position':'absolute'
    })
  }else{
    $('.aside').css({
      'position':'fixed'
    })
  }

};
  import pageIndex from './pages/loginPage/loginPage'
  export default {
    name: "app",
    computed: {
      ...mapState({
        uid:state=>state.app.loginState.uid
      }),
      desgin() {
        return this.$store.state.app.desgin;
      }
    },
    components:{
      pageIndex
    },
    methods:{
      ...mapMutations(['changeLoginStatus'])
},
    beforeCreate() {
      this.$store.dispatch("initScene");
    },
    mounted() {
        let device={
            width:$('body').width(),
            height:$('body').height()
        }
        console.log(this.design)
//      beeflex(this.desgin, options => {
//        let device = {
//          width: options.width,
//          height: options.height
//        };
//        this.$store.commit("appSetDevice", device);
//      });
    },
    created(){
        if(localStorage.getItem('uid')){
            this.changeLoginStatus({
              isExit:1
            })
        }
    }
  };
</script>

<style lang="stylus">
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  height: 100%;
  width 100%
}
  body,html{
    max-width 750px
    margin 0 auto
  }

li,ul{
  list-style none
}
</style>
